/*
 * Created: 2022-08-27 08:31:04
 * Author : 涛涛涛
 */

import React, { FC, useContext } from 'react';
import { View, Text, Image } from '@tarojs/components';
import { styled } from 'linaria/react';
import { useClassName } from '@/utils/index';
import { ProductExhibitionContext } from '@/pages/ProductExhibition/ProductExhibitionContext';
import ProductImg from '@/pages/components/ProductImg/ProductImg';
export interface IProps extends ICompProps {}
CoverImg.defaultProps = {} as Partial<IProps>;
function CoverImg(props: IProps) {
    const { className, style } = props;
    const localClassName = useClassName('CoverImg', className);
    const { product } = useContext(ProductExhibitionContext);

    return (
        <RootView className={localClassName} style={style}>
            <ProductImg src={product.artwork.iconUrl}></ProductImg>
        </RootView>
    );
}
export default React.memo(CoverImg as FC<IProps>);
const RootView = styled(View)`
    &.CoverImg {
        margin: 30px auto 0;
        width: 680px;
        height: 680px;
    }
`;
